package com.kuaimacode.kframework.api.service.sys;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kuaimacode.kframework.mybatis.mapper.sys.TokenBlackMapper;
import com.kuaimacode.kframework.mybatis.models.sys.TokenBlack;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;

/**
 * @author qinyong
 * @Title:
 * @Package com.kuaimacode.kframework.api.service.sys
 * @Description: created by IntelliJ IDEA
 * @date 2019-04-13 15:42
 */
@Service
public class TokenBlackService extends ServiceImpl<TokenBlackMapper, TokenBlack> {

    public boolean existsToken(String token) {
        QueryWrapper<TokenBlack> wrapper = new QueryWrapper<>();
        wrapper.eq("token", token);
        return CollectionUtils.isEmpty(baseMapper.selectList(wrapper));
    }
}
